
class P445_39643 {

	public static void main(String[] args) {
		String line;
		
		StringBuffer input;
		
		while (true) {
			input = new StringBuffer();
			
			line = readLn();
			
			while (true) {
				if (line == null || "".equals(line.trim())) break;
				input.append(line.trim());
				line = readLn();
				
				if (line != null && !"".equals(line.trim())) input.append("!");
				
			}
			
//			System.out.println(input);
			
			process(input.toString());
			
			
			
			if (line == null) break;
			else System.out.println();
		}
		
	}
	
	
	private static void process(String line) {
		
		StringBuffer maze = new StringBuffer();
		
		for (int k = 0; k < line.length();) {
			
			if (line.charAt(k) == '!') {
				maze.append("\n");
				k++;
				continue;
			}
			
			int number =  line.charAt(k) - '0'; 
			
			k++;
			while (k < line.length() && Character.isDigit(line.charAt(k))) {
				number = number + (int)(line.charAt(k) - '0');
				k++;
			}
			
			if (k >= line.length()) break;
			
			char c = line.charAt(k) == 'b' ? ' ' : line.charAt(k);
			
			for (int j = 0; j < number; j++) {
				maze.append(c);
			}
			
			k++;
			
		}
		
		System.out.println(maze.toString());
		
		
	}


	static String readLn() {
	       String newLine = System.getProperty("line.separator");
	       StringBuffer buffer = new StringBuffer();
	       int car = -1;
	       try {
	           car = System.in.read();
	           while ((car > 0) && (car != newLine.charAt(0))) {
	               buffer.append((char) car);
	               car = System.in.read();
	           }
	           if (car == newLine.charAt(0))
	               System.in.skip(newLine.length() - 1);
	       } catch (java.io.IOException e) {
	           return (null);
	       }
	       if ((car < 0) && (buffer.length() == 0))
	           return (null);
	       return (buffer.toString());
	   }
}
